package util;

import com.badlogic.gdx.InputProcessor;

public class MouseProcessor implements InputProcessor {
	
	private CoordinateConverter xyConverter;
	public MouseProcessor(CoordinateConverter coordinateConverter) {
		xyConverter = coordinateConverter;
	}
	
	public boolean touchUp(int x, int y, int pointer, int button) {
		displayMessage("touchUp  x="+ x + " y=" + y);
		int col = xyConverter.getColFromXY(x, y);
		int row = xyConverter.getRowFromXY(x, y);
		displayMessage("touchUp  col="+ col + " row=" + row);
		return true;
	}
	
	public boolean touchMoved(int x, int y) {
		return false;
	}
	
	private void displayMessage(String message) {
		System.out.println(message);				
	}

	public boolean touchDragged(int x, int y, int pointer) {
		return false;
	}
	
	public boolean touchDown(int x, int y, int pointer, int button) {
		displayMessage("touchDown  x="+ x + " y=" + y);
		int col = xyConverter.getColFromXY(x, y);
		int row = xyConverter.getRowFromXY(x, y);
		System.out.println("touchDown  col="+ col + " row=" + row);
		return true;
	}

	public boolean scrolled(int amount) {
		// TODO Auto-generated method stub
		return false;
	}
	
	public boolean keyUp(int keycode) {
		// TODO Auto-generated method stub
		return false;
	}
	
	public boolean keyTyped(char character) {
		// TODO Auto-generated method stub
		return false;
	}
	
	public boolean keyDown(int keycode) {
		// TODO Auto-generated method stub
		return false;
	}

}
